require 'java'

require 'picounit/suite/directory'
require 'picounit/suite/exceptions'

class ClassName
  def initialize(class_name)
    @class_name = class_name
  end

  def containing_directory
    Directory.new(as_class.getResource('.').file)
  end

  private
  def as_class
    java.lang.Class.forName(@class_name)
  rescue class_not_found
    raise InvalidClassName.new(@class_name, class_not_found)
  end
end